package com.yuan.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

//@Controller
//@ResponseBody
@RestController  //简写 等于：@Controller+@ResponseBody

@RequestMapping("/hello")
public class HelloController {

    @GetMapping("/demo1")
//    @ResponseBody
    public String demo1() {
        System.out.println("=====>  hello demo1");
        return "/success.html";
    }

//    @GetMapping("/testPath/?")  //问号是单个字符
    @GetMapping("/testPath/*") //任意的数量的字符
//    @GetMapping("/testPath/**") //任意的数量的字符任意层的路径
    public String testPath() {
        System.out.println("=====>  hello testPath");
        return "testPath!!!";
    }



}
